package emulator.hardware.nmos6502.commands;

import emulator.hardware.memory.UnmappedMemoryException;
import emulator.hardware.nmos6502.Command;
import emulator.hardware.nmos6502.CommandSet;
import emulator.hardware.nmos6502.Cpu6502;
import emulator.hardware.nmos6502.Flags6502;
import emulator.hardware.nmos6502.Operand;
import emulator.hardware.nmos6502.operands.*;

/** CLD (CLear Decimal) */
public class CLD implements Command {

	@Override
	public void execute(Cpu6502 cpu, Operand operand) throws OperandException,
			UnmappedMemoryException, IllegalOpcodeException {
		Flags6502 flags = cpu.getFlags();
		flags.setDecimal(false);
		cpu.setFlags(flags);
	}

	@Override
	public String getName() {
		return "CLD";
	}

	@Override
	public void register(CommandSet cset) {
		cset.defineCommand(0xD8, this, new NoOperand());
	}

}
